Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

list_refs #318

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

list_refs #318

wants to merge 1 commit into from

Conversation

dcherian
Copy link
Contributor

Closes #136

Closes #136
@@ -3,6 +3,12 @@ import datetime
from collections.abc import AsyncGenerator
from typing import Any

class Ref:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really the model we want to return to users?

Alternatives could be:

  1. Arraylake style Pydantic models: BranchName(str) and TagName(str)
  2. or,
class RefType(Enum):
    BRANCH = auto()
    TAG = auto()

class Ref:
    name: str
    kind: RefType

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sorry, forgot to comment. i like your approach best, but I'd like to see how easy/hard is to pattern match the result in python. Probably tests will show me that.

Other option would be to have separate functions, list_tags and list_branches, or maybe the three of them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that tags and branches can be in separate functions and that simplifies a lot from the Python user perspective

}

#[pymethods]
impl PyRef {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beautiful

@@ -432,6 +464,25 @@ impl PyIcechunkStore {
Ok(snapshot_id.to_string())
}

fn list_refs<'py>(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we also provide async_list_refs?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add a python test that exercises this new function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I can do both. I'd like some input on #318 (comment) first before I tackle those.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add python support for listing all refs
3 participants